package com.zhou.common.mybatis.template.controller;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.zhou.common.lib.model.Response;
import com.zhou.common.mybatis.template.entity.RequestExpress;
import com.zhou.common.mybatis.template.model.ao.RequestExpressQueryAo;
import com.zhou.common.mybatis.template.service.impl.RequestExpressServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 诉求 前端控制器
 * </p>
 *
 * @author zxf
 * @since 2023-02-18
 */
@ApiSupport(order = 283)
@Api(tags = "企业诉求web模块")
@RestController
@RequestMapping("/request-express")
public class RequestExpressController {

    @Autowired
    private RequestExpressServiceImpl requestExpressService;

    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "查询企业诉求接口")
    @PostMapping("/query")
    public Response query(@RequestBody RequestExpressQueryAo queryAo ){
        List<RequestExpress> list = requestExpressService.list();
        return Response.success(list);
    }

    @ApiOperationSupport(order = 1)
    @ApiImplicitParam(name = "name",value = "姓名",required = true)
    @ApiOperation(value = "向客人问好")
    @GetMapping("/sayHi")
    public ResponseEntity<String> sayHi(@RequestParam(value = "name")String name){
        return ResponseEntity.ok("Hi:"+name);
    }
}
